import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {// 主页
    path: '/',
    name: 'home',
    component: HomeView
  },
  {// 个人中心
    path: '/myself',
    name: 'myself',
    component: () => import('../views/MyselfView.vue')
  },
  {// 详情
    path: '/newspaper',
    name: 'newspaper',
    component: () => import('../views/NewspaperView.vue')
  },
  {// 登录
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {// 注册
    path: '/regist',
    name: 'regist',
    component: () => import('../views/RegistView.vue')
  },
  {// 更改密码
    path: '/changepwd',
    name: 'changepwd',
    component: () => import('../views/ChangepwdView.vue')
  },
  {// 收藏页
    path: '/collect',
    name: 'collect',
    component: () => import('../views/CollectView.vue')
  },
  {// 404界面
    path: '/*',
    name: 'error',
    component: () => import('../views/ErrorView.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
